// UsesProcTable.h : stores the variables used in each procedure.
// Author: Achyut P Balaji
//

#ifndef USES_PROC_TABLE_H
#define USES_PROC_TABLE_H
#include"../../SPA_Data_Types.h"

using namespace std;

typedef vector<VAR_INDEX> VAR_LIST;

class UsesProcTable {
private:

	vector<VAR_LIST> variablesUsed;
	
	static UsesProcTable *obj;
	UsesProcTable();
	
	bool initialised;

public:

	static UsesProcTable* getInstance();
	static UsesProcTable* getFirstInstance();

	BOOLEAN addEntry(PROC_INDEX p,VAR_LIST varUsed);

	BOOLEAN isUsed(PROC_INDEX n, VAR_INDEX ind);
	VAR_LIST* getVarUsed(PROC_INDEX n);

	void initialise();
	void initial(int size);

};


#endif